package com.xianyun.book.domain.user;

import com.alibaba.cola.exception.BizException;

/**
 * @author ytt
 */
public enum Gender {
    /**男*/
    MAN(0),
    /**女*/
    WOM(1);
    private final Integer gender;

    Gender(Integer gender) {
        this.gender = gender;
    }
    public static Gender getGenderType(Integer typeId){
        for (Gender type: values()){
            if (type.gender .equals( typeId)){
                return type;
            }
        }
        throw  new BizException("GENDER_TYPE_NOT_FOUND");
    }

    public Integer getGender() {
        return gender;
    }
}
